package com.example.order;

import com.example.order.model.OrderMainVo;
import com.example.order.service.OrderServiceImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableFeignClients
@EnableDiscoveryClient
@MapperScan("com.example.order.mapper")
@RestController
public class OrderApplication {
    @Autowired
    private OrderServiceImpl orderService;

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }

    @PostMapping("/{orderNo}")
    public OrderMainVo confirmOrder(@PathVariable Long orderNo) {
        OrderMainVo orderMainVo = orderService.confirmOrder(202103241154L);
        return orderMainVo;
    }
}
